﻿using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace FileManager_Client.PresentationLayer.NewUi
{
    public class BaseForm : XtraForm
    {
        internal BaseForm()
         {
             LookAndFeel.SetSkinStyle("Wizard97");
            StartPosition = FormStartPosition.CenterScreen;
            Shown += BaseForm_Shown;
         }

        void BaseForm_Shown(object sender, System.EventArgs e)
        {
            var title = Text.IndexOf("Version", System.StringComparison.Ordinal);
            if (title != -1)
            {
                Text = Text.Replace(Text.Substring(title), "");
                Text = Text.Trim();
            }
            if (!Text.Contains("Version"))
                Text += string.Format("      Version: {0}",
                                      System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
        }
    }
}